import { useState, forwardRef, Ref } from 'react';
import HeaderForm from './Components/HeaderForm';
import TableList from './Components/TableList';
import api from './api';
import './index.less';
type IRef = Ref<ReturnType<typeof api>>;
export interface IProps {
  callBackEvents: {
    loadListData?: (param: {
      page: number;
      pageSize: number;
      searchText: string;
      groupId?: string;
    }) => object[];
  };
  inbiz: any;
}

export interface LoProps {
  page: number;
  pageSize: number;
  processInstanceId?: string;
  starter?: string;
  processName?: string;
  processGroupName?: string;
  state?: string;
  startTime?: any;
  entTime?: any;
}

const ProcessMonitoring = (props: IProps, ref: IRef) => {
  // 查询
  const [queryParams, setQueryParams] = useState({});
  const [expand, setExpand] = useState(false);
  const [state,setState] = useState(0)

  return (
    <div className="inbiz-process-monitoring-component">
      {/* 头部表单 */}
      <HeaderForm setQueryParams={setQueryParams} {...props} expand={expand} setExpand={setExpand} setState={setState}/>

      {/* 表格列表 */}
      <TableList queryParams={queryParams} refs={ref} {...props} expand={expand} state={state}/>
    </div>
  );
};

export default forwardRef(ProcessMonitoring);
